<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<UserListModel>" %>
<%@ Import Namespace="Netkk.Core"%>
<%@ Import Namespace="Netkk.Models"%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Mitglieder - .NET-Stammtisch Konstanz-Kreuzlingen</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1>
        .NET-Stammtisch Mitglieder</h1>
    <p>
        Das sind alle Mitglieder des .NET Stammtisches Konstanz-Kreuzlingen</p>
    <p>
        <%= Html.PagerLinks("Member", "Index", Model.TotalPages , Model.CurrentPage, "pager", "more", "")%></p>
    <%foreach (UserModel user in Model.Users)
      {
          if (!user.AllowShowProfile && Model.ShowCreateUser)
          {
              continue;
          }%>
    <p>
        <strong>
            <%
                if (!String.IsNullOrEmpty(user.FirstName) || !String.IsNullOrEmpty(user.LastName))
                {%>
            <%=user.FirstName%>
            <%=user.LastName%>
            <%}
                else
                {%>
            <%=user.Name%>
            <%
                }%>
        </strong>
        <%
            if (user.Role.Role == Netkk.Common.Roles.Admin)
            {%>
        (Admin)
        <%
            }%>
        <br />
        <%
            if (!String.IsNullOrEmpty(user.Website))
            {
                string[] sites = user.Website.Split(';');
                for (int i = 0; i < sites.Length; i++)
                {
        %>
        <a href="<%=sites[i]%>">
            <%=sites[i]%></a><br />
        <%
            }
            }%></p>
    <p>
        <%
            if (Page.User.Identity.IsAuthenticated)
            {%>
        <a href="<%=Html.Action("Member", "Details", user.Id)%>" class="user button">Ansehen</a>
        <%
            }%>
        <%
            if (Model.ShowCreateUser || user.AllowEdit)
            {%>
        <a href="<%=Html.Action("Member", "Edit", user.Id)%>" class="useredit button">Bearbeiten</a>
        <%
            }%>
        <%if (Model.ShowCreateUser && user.AllowSendEmails)
          {%>
        <a href="<%=Html.Action("Contact", "Email", user.Id)%>" class="mail button"><span>E-Mail</span></a>
        <%}%>
    </p>
    <%}%>
    <p>
        <%= Html.PagerLinks("Member", "Index", Model.TotalPages, Model.CurrentPage, "pager", "more", "")%></p>
</asp:Content>
